package lapsnake.model.stmt;

import lapsnake.model.*;
import lapsnake.model.data.*;
import lapsnake.py.ast.ASTHelperFactory; 
import java.beans.PropertyVetoException;

import org.python.antlr.ast.*;

/**Wrapper class with helper functions for TryFinally nodes*/
public class LapTryFinally extends LapStatement {
	public final ChildList<LapStatement> body = new ChildList<>(this, LapStatement.class, false);
	@NewRow public final ChildList<LapStatement> finalBody = new ChildList<>(this, LapStatement.class, false);
	
	public LapTryFinally(PyAST pyAST, ChildField<? super LapTryFinally> parent, TryFinally node) throws PropertyVetoException {
		super(pyAST, parent, node);
		
		ASTHelperFactory.makeHelpers(pyAST, body, node.getInternalBody());
		ASTHelperFactory.makeHelpers(pyAST, finalBody, node.getInternalFinalbody());
		
		buildTextNodes(node);
	}
}
